package com.jy.admin.db.dao.impl;
import com.fqgj.common.api.Page;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.jy.admin.db.dao.SpendingDetailDao;
import com.jy.admin.db.entity.SpendingDetailEntity;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
* User: anonymous
* Date: 2021-10-30
* Time: 11:50:16.593
*/

@Repository
public class SpendingDetailDaoImpl extends AbstractBaseMapper<SpendingDetailEntity> implements SpendingDetailDao {

    @Override
    public List<SpendingDetailEntity> selectListByPage(Page page, long sTime, long eTime) {
        Map<String, Object> paramMap = Maps.newHashMap();
        paramMap.put("sTime", sTime);
        paramMap.put("eTime", eTime);
        if (page != null) {
            paramMap.put("page", page);
        }
        return getSqlSession().selectList(this.getStatement("selectListByPage"), paramMap);
    }

    @Override
    public Integer selectSpendingCount() {
        return getSqlSession().selectOne(this.getStatement("selectSpendingCount"));
    }
}